package edu.bistu.sim.xwy.blog.Service;

import edu.bistu.sim.xwy.blog.Controller.Repository.CollectInfoRepository;
import edu.bistu.sim.xwy.blog.Controller.Repository.NewsComRepository;
import edu.bistu.sim.xwy.blog.domain.BusUser;
import edu.bistu.sim.xwy.blog.domain.CollectInfo;
import edu.bistu.sim.xwy.blog.domain.NewsCom;
import edu.bistu.sim.xwy.blog.domain.NewsInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CollectInfoService {

    @Autowired
    private CollectInfoRepository colsComRepository;

    public CollectInfo save(CollectInfo collectInfo){
        return colsComRepository.save(collectInfo);
    }
    public List<CollectInfo> findAllNewsBytel(String user_tel){
        System.out.println("user_tel is"+ user_tel);
        return colsComRepository.findAllNewsBytel(user_tel);
    }
    public List<CollectInfo> findAll(){
        return colsComRepository.findAll();
    }
    public void deleteCol(NewsInfo col_news){
        colsComRepository.deleteCol(col_news);
    }
}
